package com.foreknow.demo9;

import java.awt.*;
import java.awt.event.ActionListener;

public class WindowDemo {
    public static void main(String[] args) {
        Frame frame= new Frame();
        //创建一个对象
        Button button = new Button("This is button");
        ActionListener action = new ActionListenerImpl();
        button.addActionListener(action);
        //将按钮加入到窗口中
        frame.add(button);

        frame.setTitle("这是一个容器");
        frame.setSize(400,400);
        frame.setVisible(true);
    }
}
